using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;
namespace CXDB
{
	/// <summary>
	/// Strongly-typed collection for the CxCompanyPingJium class.
	/// </summary>
    [Serializable]
	public partial class CxCompanyPingJiumCollection : ActiveList<CxCompanyPingJium, CxCompanyPingJiumCollection>
	{	   
		public CxCompanyPingJiumCollection() {}
        
        /// <summary>
		/// Filters an existing collection based on the set criteria. This is an in-memory filter
		/// Thanks to developingchris for this!
        /// </summary>
        /// <returns>CxCompanyPingJiumCollection</returns>
		public CxCompanyPingJiumCollection Filter()
        {
            for (int i = this.Count - 1; i > -1; i--)
            {
                CxCompanyPingJium o = this[i];
                foreach (SubSonic.Where w in this.wheres)
                {
                    bool remove = false;
                    System.Reflection.PropertyInfo pi = o.GetType().GetProperty(w.ColumnName);
                    if (pi.CanRead)
                    {
                        object val = pi.GetValue(o, null);
                        switch (w.Comparison)
                        {
                            case SubSonic.Comparison.Equals:
                                if (!val.Equals(w.ParameterValue))
                                {
                                    remove = true;
                                }
                                break;
                        }
                    }
                    if (remove)
                    {
                        this.Remove(o);
                        break;
                    }
                }
            }
            return this;
        }
		
		
	}
	/// <summary>
	/// This is an ActiveRecord class which wraps the CX_Company_PingJia table.
	/// </summary>
	[Serializable]
	public partial class CxCompanyPingJium : ActiveRecord<CxCompanyPingJium>, IActiveRecord
	{
		#region .ctors and Default Settings
		
		public CxCompanyPingJium()
		{
		  SetSQLProps();
		  InitSetDefaults();
		  MarkNew();
		}
		
		private void InitSetDefaults() { SetDefaults(); }
		
		public CxCompanyPingJium(bool useDatabaseDefaults)
		{
			SetSQLProps();
			if(useDatabaseDefaults)
				ForceDefaults();
			MarkNew();
		}
        
		public CxCompanyPingJium(object keyID)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByKey(keyID);
		}
		 
		public CxCompanyPingJium(string columnName, object columnValue)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByParam(columnName,columnValue);
		}
		
		protected static void SetSQLProps() { GetTableSchema(); }
		
		#endregion
		
		#region Schema and Query Accessor	
		public static Query CreateQuery() { return new Query(Schema); }
		public static TableSchema.Table Schema
		{
			get
			{
				if (BaseSchema == null)
					SetSQLProps();
				return BaseSchema;
			}
		}
		
		private static void GetTableSchema() 
		{
			if(!IsSchemaInitialized)
			{
				//Schema declaration
				TableSchema.Table schema = new TableSchema.Table("CX_Company_PingJia", TableType.Table, DataService.GetInstance("CXDB"));
				schema.Columns = new TableSchema.TableColumnCollection();
				schema.SchemaName = @"dbo";
				//columns
				
				TableSchema.TableColumn colvarId = new TableSchema.TableColumn(schema);
				colvarId.ColumnName = "ID";
				colvarId.DataType = DbType.Int32;
				colvarId.MaxLength = 0;
				colvarId.AutoIncrement = true;
				colvarId.IsNullable = false;
				colvarId.IsPrimaryKey = true;
				colvarId.IsForeignKey = false;
				colvarId.IsReadOnly = false;
				colvarId.DefaultSetting = @"";
				colvarId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarId);
				
				TableSchema.TableColumn colvarCompanyID = new TableSchema.TableColumn(schema);
				colvarCompanyID.ColumnName = "CompanyID";
				colvarCompanyID.DataType = DbType.AnsiStringFixedLength;
				colvarCompanyID.MaxLength = 100;
				colvarCompanyID.AutoIncrement = false;
				colvarCompanyID.IsNullable = true;
				colvarCompanyID.IsPrimaryKey = false;
				colvarCompanyID.IsForeignKey = false;
				colvarCompanyID.IsReadOnly = false;
				colvarCompanyID.DefaultSetting = @"";
				colvarCompanyID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCompanyID);
				
				TableSchema.TableColumn colvarCompanyName = new TableSchema.TableColumn(schema);
				colvarCompanyName.ColumnName = "CompanyName";
				colvarCompanyName.DataType = DbType.String;
				colvarCompanyName.MaxLength = 100;
				colvarCompanyName.AutoIncrement = false;
				colvarCompanyName.IsNullable = true;
				colvarCompanyName.IsPrimaryKey = false;
				colvarCompanyName.IsForeignKey = false;
				colvarCompanyName.IsReadOnly = false;
				colvarCompanyName.DefaultSetting = @"";
				colvarCompanyName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCompanyName);
				
				TableSchema.TableColumn colvarUnFeeTime = new TableSchema.TableColumn(schema);
				colvarUnFeeTime.ColumnName = "unFee_time";
				colvarUnFeeTime.DataType = DbType.DateTime;
				colvarUnFeeTime.MaxLength = 0;
				colvarUnFeeTime.AutoIncrement = false;
				colvarUnFeeTime.IsNullable = true;
				colvarUnFeeTime.IsPrimaryKey = false;
				colvarUnFeeTime.IsForeignKey = false;
				colvarUnFeeTime.IsReadOnly = false;
				colvarUnFeeTime.DefaultSetting = @"";
				colvarUnFeeTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarUnFeeTime);
				
				TableSchema.TableColumn colvarUnFeeCash = new TableSchema.TableColumn(schema);
				colvarUnFeeCash.ColumnName = "unFee_Cash";
				colvarUnFeeCash.DataType = DbType.Int32;
				colvarUnFeeCash.MaxLength = 0;
				colvarUnFeeCash.AutoIncrement = false;
				colvarUnFeeCash.IsNullable = true;
				colvarUnFeeCash.IsPrimaryKey = false;
				colvarUnFeeCash.IsForeignKey = false;
				colvarUnFeeCash.IsReadOnly = false;
				colvarUnFeeCash.DefaultSetting = @"";
				colvarUnFeeCash.ForeignKeyTableName = "";
				schema.Columns.Add(colvarUnFeeCash);
				
				TableSchema.TableColumn colvarUnFeeDetail = new TableSchema.TableColumn(schema);
				colvarUnFeeDetail.ColumnName = "unFee_Detail";
				colvarUnFeeDetail.DataType = DbType.String;
				colvarUnFeeDetail.MaxLength = 1073741823;
				colvarUnFeeDetail.AutoIncrement = false;
				colvarUnFeeDetail.IsNullable = true;
				colvarUnFeeDetail.IsPrimaryKey = false;
				colvarUnFeeDetail.IsForeignKey = false;
				colvarUnFeeDetail.IsReadOnly = false;
				colvarUnFeeDetail.DefaultSetting = @"";
				colvarUnFeeDetail.ForeignKeyTableName = "";
				schema.Columns.Add(colvarUnFeeDetail);
				
				TableSchema.TableColumn colvarThiefTime1 = new TableSchema.TableColumn(schema);
				colvarThiefTime1.ColumnName = "thief_Time1";
				colvarThiefTime1.DataType = DbType.DateTime;
				colvarThiefTime1.MaxLength = 0;
				colvarThiefTime1.AutoIncrement = false;
				colvarThiefTime1.IsNullable = true;
				colvarThiefTime1.IsPrimaryKey = false;
				colvarThiefTime1.IsForeignKey = false;
				colvarThiefTime1.IsReadOnly = false;
				colvarThiefTime1.DefaultSetting = @"";
				colvarThiefTime1.ForeignKeyTableName = "";
				schema.Columns.Add(colvarThiefTime1);
				
				TableSchema.TableColumn colvarThiefTime2 = new TableSchema.TableColumn(schema);
				colvarThiefTime2.ColumnName = "thief_Time2";
				colvarThiefTime2.DataType = DbType.DateTime;
				colvarThiefTime2.MaxLength = 0;
				colvarThiefTime2.AutoIncrement = false;
				colvarThiefTime2.IsNullable = true;
				colvarThiefTime2.IsPrimaryKey = false;
				colvarThiefTime2.IsForeignKey = false;
				colvarThiefTime2.IsReadOnly = false;
				colvarThiefTime2.DefaultSetting = @"";
				colvarThiefTime2.ForeignKeyTableName = "";
				schema.Columns.Add(colvarThiefTime2);
				
				TableSchema.TableColumn colvarThiefCash = new TableSchema.TableColumn(schema);
				colvarThiefCash.ColumnName = "thief_Cash";
				colvarThiefCash.DataType = DbType.Int32;
				colvarThiefCash.MaxLength = 0;
				colvarThiefCash.AutoIncrement = false;
				colvarThiefCash.IsNullable = true;
				colvarThiefCash.IsPrimaryKey = false;
				colvarThiefCash.IsForeignKey = false;
				colvarThiefCash.IsReadOnly = false;
				colvarThiefCash.DefaultSetting = @"";
				colvarThiefCash.ForeignKeyTableName = "";
				schema.Columns.Add(colvarThiefCash);
				
				TableSchema.TableColumn colvarThiefDetail = new TableSchema.TableColumn(schema);
				colvarThiefDetail.ColumnName = "thief_Detail";
				colvarThiefDetail.DataType = DbType.String;
				colvarThiefDetail.MaxLength = 1073741823;
				colvarThiefDetail.AutoIncrement = false;
				colvarThiefDetail.IsNullable = true;
				colvarThiefDetail.IsPrimaryKey = false;
				colvarThiefDetail.IsForeignKey = false;
				colvarThiefDetail.IsReadOnly = false;
				colvarThiefDetail.DefaultSetting = @"";
				colvarThiefDetail.ForeignKeyTableName = "";
				schema.Columns.Add(colvarThiefDetail);
				
				TableSchema.TableColumn colvarUnCoopPeakTime = new TableSchema.TableColumn(schema);
				colvarUnCoopPeakTime.ColumnName = "unCoop_Peak_time";
				colvarUnCoopPeakTime.DataType = DbType.DateTime;
				colvarUnCoopPeakTime.MaxLength = 0;
				colvarUnCoopPeakTime.AutoIncrement = false;
				colvarUnCoopPeakTime.IsNullable = true;
				colvarUnCoopPeakTime.IsPrimaryKey = false;
				colvarUnCoopPeakTime.IsForeignKey = false;
				colvarUnCoopPeakTime.IsReadOnly = false;
				colvarUnCoopPeakTime.DefaultSetting = @"";
				colvarUnCoopPeakTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarUnCoopPeakTime);
				
				TableSchema.TableColumn colvarUnCoopPeakDetail = new TableSchema.TableColumn(schema);
				colvarUnCoopPeakDetail.ColumnName = "unCoop_Peak_Detail";
				colvarUnCoopPeakDetail.DataType = DbType.String;
				colvarUnCoopPeakDetail.MaxLength = 1073741823;
				colvarUnCoopPeakDetail.AutoIncrement = false;
				colvarUnCoopPeakDetail.IsNullable = true;
				colvarUnCoopPeakDetail.IsPrimaryKey = false;
				colvarUnCoopPeakDetail.IsForeignKey = false;
				colvarUnCoopPeakDetail.IsReadOnly = false;
				colvarUnCoopPeakDetail.DefaultSetting = @"";
				colvarUnCoopPeakDetail.ForeignKeyTableName = "";
				schema.Columns.Add(colvarUnCoopPeakDetail);
				
				TableSchema.TableColumn colvarUnCoopLimitTime = new TableSchema.TableColumn(schema);
				colvarUnCoopLimitTime.ColumnName = "unCoop_Limit_time";
				colvarUnCoopLimitTime.DataType = DbType.DateTime;
				colvarUnCoopLimitTime.MaxLength = 0;
				colvarUnCoopLimitTime.AutoIncrement = false;
				colvarUnCoopLimitTime.IsNullable = true;
				colvarUnCoopLimitTime.IsPrimaryKey = false;
				colvarUnCoopLimitTime.IsForeignKey = false;
				colvarUnCoopLimitTime.IsReadOnly = false;
				colvarUnCoopLimitTime.DefaultSetting = @"";
				colvarUnCoopLimitTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarUnCoopLimitTime);
				
				TableSchema.TableColumn colvarUnCoopLimitDetail = new TableSchema.TableColumn(schema);
				colvarUnCoopLimitDetail.ColumnName = "unCoop_Limit_Detail";
				colvarUnCoopLimitDetail.DataType = DbType.String;
				colvarUnCoopLimitDetail.MaxLength = 1073741823;
				colvarUnCoopLimitDetail.AutoIncrement = false;
				colvarUnCoopLimitDetail.IsNullable = true;
				colvarUnCoopLimitDetail.IsPrimaryKey = false;
				colvarUnCoopLimitDetail.IsForeignKey = false;
				colvarUnCoopLimitDetail.IsReadOnly = false;
				colvarUnCoopLimitDetail.DefaultSetting = @"";
				colvarUnCoopLimitDetail.ForeignKeyTableName = "";
				schema.Columns.Add(colvarUnCoopLimitDetail);
				
				TableSchema.TableColumn colvarUnCoopOthers = new TableSchema.TableColumn(schema);
				colvarUnCoopOthers.ColumnName = "unCoop_Others";
				colvarUnCoopOthers.DataType = DbType.String;
				colvarUnCoopOthers.MaxLength = 1073741823;
				colvarUnCoopOthers.AutoIncrement = false;
				colvarUnCoopOthers.IsNullable = true;
				colvarUnCoopOthers.IsPrimaryKey = false;
				colvarUnCoopOthers.IsForeignKey = false;
				colvarUnCoopOthers.IsReadOnly = false;
				colvarUnCoopOthers.DefaultSetting = @"";
				colvarUnCoopOthers.ForeignKeyTableName = "";
				schema.Columns.Add(colvarUnCoopOthers);
				
				TableSchema.TableColumn colvarEnterUserId = new TableSchema.TableColumn(schema);
				colvarEnterUserId.ColumnName = "Enter_user_ID";
				colvarEnterUserId.DataType = DbType.Int32;
				colvarEnterUserId.MaxLength = 0;
				colvarEnterUserId.AutoIncrement = false;
				colvarEnterUserId.IsNullable = true;
				colvarEnterUserId.IsPrimaryKey = false;
				colvarEnterUserId.IsForeignKey = false;
				colvarEnterUserId.IsReadOnly = false;
				colvarEnterUserId.DefaultSetting = @"";
				colvarEnterUserId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarEnterUserId);
				
				TableSchema.TableColumn colvarDeptMasterId = new TableSchema.TableColumn(schema);
				colvarDeptMasterId.ColumnName = "Dept_Master_ID";
				colvarDeptMasterId.DataType = DbType.Int32;
				colvarDeptMasterId.MaxLength = 0;
				colvarDeptMasterId.AutoIncrement = false;
				colvarDeptMasterId.IsNullable = true;
				colvarDeptMasterId.IsPrimaryKey = false;
				colvarDeptMasterId.IsForeignKey = false;
				colvarDeptMasterId.IsReadOnly = false;
				colvarDeptMasterId.DefaultSetting = @"";
				colvarDeptMasterId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDeptMasterId);
				
				TableSchema.TableColumn colvarDeptMasterRemark = new TableSchema.TableColumn(schema);
				colvarDeptMasterRemark.ColumnName = "Dept_Master_Remark";
				colvarDeptMasterRemark.DataType = DbType.String;
				colvarDeptMasterRemark.MaxLength = 1073741823;
				colvarDeptMasterRemark.AutoIncrement = false;
				colvarDeptMasterRemark.IsNullable = true;
				colvarDeptMasterRemark.IsPrimaryKey = false;
				colvarDeptMasterRemark.IsForeignKey = false;
				colvarDeptMasterRemark.IsReadOnly = false;
				colvarDeptMasterRemark.DefaultSetting = @"";
				colvarDeptMasterRemark.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDeptMasterRemark);
				
				TableSchema.TableColumn colvarDeptMasterStatus = new TableSchema.TableColumn(schema);
				colvarDeptMasterStatus.ColumnName = "Dept_Master_status";
				colvarDeptMasterStatus.DataType = DbType.Int32;
				colvarDeptMasterStatus.MaxLength = 0;
				colvarDeptMasterStatus.AutoIncrement = false;
				colvarDeptMasterStatus.IsNullable = true;
				colvarDeptMasterStatus.IsPrimaryKey = false;
				colvarDeptMasterStatus.IsForeignKey = false;
				colvarDeptMasterStatus.IsReadOnly = false;
				colvarDeptMasterStatus.DefaultSetting = @"";
				colvarDeptMasterStatus.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDeptMasterStatus);
				
				TableSchema.TableColumn colvarDeptMasterEnteringTime = new TableSchema.TableColumn(schema);
				colvarDeptMasterEnteringTime.ColumnName = "Dept_Master_Entering_time";
				colvarDeptMasterEnteringTime.DataType = DbType.DateTime;
				colvarDeptMasterEnteringTime.MaxLength = 0;
				colvarDeptMasterEnteringTime.AutoIncrement = false;
				colvarDeptMasterEnteringTime.IsNullable = true;
				colvarDeptMasterEnteringTime.IsPrimaryKey = false;
				colvarDeptMasterEnteringTime.IsForeignKey = false;
				colvarDeptMasterEnteringTime.IsReadOnly = false;
				colvarDeptMasterEnteringTime.DefaultSetting = @"";
				colvarDeptMasterEnteringTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDeptMasterEnteringTime);
				
				TableSchema.TableColumn colvarOtherMasterId = new TableSchema.TableColumn(schema);
				colvarOtherMasterId.ColumnName = "other_master_id";
				colvarOtherMasterId.DataType = DbType.Int32;
				colvarOtherMasterId.MaxLength = 0;
				colvarOtherMasterId.AutoIncrement = false;
				colvarOtherMasterId.IsNullable = true;
				colvarOtherMasterId.IsPrimaryKey = false;
				colvarOtherMasterId.IsForeignKey = false;
				colvarOtherMasterId.IsReadOnly = false;
				colvarOtherMasterId.DefaultSetting = @"";
				colvarOtherMasterId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarOtherMasterId);
				
				TableSchema.TableColumn colvarOtherMasterTime = new TableSchema.TableColumn(schema);
				colvarOtherMasterTime.ColumnName = "other_master_time";
				colvarOtherMasterTime.DataType = DbType.DateTime;
				colvarOtherMasterTime.MaxLength = 0;
				colvarOtherMasterTime.AutoIncrement = false;
				colvarOtherMasterTime.IsNullable = true;
				colvarOtherMasterTime.IsPrimaryKey = false;
				colvarOtherMasterTime.IsForeignKey = false;
				colvarOtherMasterTime.IsReadOnly = false;
				colvarOtherMasterTime.DefaultSetting = @"";
				colvarOtherMasterTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarOtherMasterTime);
				
				TableSchema.TableColumn colvarOtherMasterStatus = new TableSchema.TableColumn(schema);
				colvarOtherMasterStatus.ColumnName = "other_master_status";
				colvarOtherMasterStatus.DataType = DbType.Int32;
				colvarOtherMasterStatus.MaxLength = 0;
				colvarOtherMasterStatus.AutoIncrement = false;
				colvarOtherMasterStatus.IsNullable = true;
				colvarOtherMasterStatus.IsPrimaryKey = false;
				colvarOtherMasterStatus.IsForeignKey = false;
				colvarOtherMasterStatus.IsReadOnly = false;
				colvarOtherMasterStatus.DefaultSetting = @"";
				colvarOtherMasterStatus.ForeignKeyTableName = "";
				schema.Columns.Add(colvarOtherMasterStatus);
				
				TableSchema.TableColumn colvarOtherMasterRemark = new TableSchema.TableColumn(schema);
				colvarOtherMasterRemark.ColumnName = "other_master_remark";
				colvarOtherMasterRemark.DataType = DbType.String;
				colvarOtherMasterRemark.MaxLength = 1073741823;
				colvarOtherMasterRemark.AutoIncrement = false;
				colvarOtherMasterRemark.IsNullable = true;
				colvarOtherMasterRemark.IsPrimaryKey = false;
				colvarOtherMasterRemark.IsForeignKey = false;
				colvarOtherMasterRemark.IsReadOnly = false;
				colvarOtherMasterRemark.DefaultSetting = @"";
				colvarOtherMasterRemark.ForeignKeyTableName = "";
				schema.Columns.Add(colvarOtherMasterRemark);
				
				TableSchema.TableColumn colvarManagerId = new TableSchema.TableColumn(schema);
				colvarManagerId.ColumnName = "Manager_ID";
				colvarManagerId.DataType = DbType.Int32;
				colvarManagerId.MaxLength = 0;
				colvarManagerId.AutoIncrement = false;
				colvarManagerId.IsNullable = true;
				colvarManagerId.IsPrimaryKey = false;
				colvarManagerId.IsForeignKey = false;
				colvarManagerId.IsReadOnly = false;
				colvarManagerId.DefaultSetting = @"";
				colvarManagerId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarManagerId);
				
				TableSchema.TableColumn colvarManagerStatus = new TableSchema.TableColumn(schema);
				colvarManagerStatus.ColumnName = "Manager_Status";
				colvarManagerStatus.DataType = DbType.Int32;
				colvarManagerStatus.MaxLength = 0;
				colvarManagerStatus.AutoIncrement = false;
				colvarManagerStatus.IsNullable = true;
				colvarManagerStatus.IsPrimaryKey = false;
				colvarManagerStatus.IsForeignKey = false;
				colvarManagerStatus.IsReadOnly = false;
				colvarManagerStatus.DefaultSetting = @"";
				colvarManagerStatus.ForeignKeyTableName = "";
				schema.Columns.Add(colvarManagerStatus);
				
				TableSchema.TableColumn colvarManagerRemark = new TableSchema.TableColumn(schema);
				colvarManagerRemark.ColumnName = "Manager_Remark";
				colvarManagerRemark.DataType = DbType.String;
				colvarManagerRemark.MaxLength = 1073741823;
				colvarManagerRemark.AutoIncrement = false;
				colvarManagerRemark.IsNullable = true;
				colvarManagerRemark.IsPrimaryKey = false;
				colvarManagerRemark.IsForeignKey = false;
				colvarManagerRemark.IsReadOnly = false;
				colvarManagerRemark.DefaultSetting = @"";
				colvarManagerRemark.ForeignKeyTableName = "";
				schema.Columns.Add(colvarManagerRemark);
				
				TableSchema.TableColumn colvarManagerRemarkTime = new TableSchema.TableColumn(schema);
				colvarManagerRemarkTime.ColumnName = "Manager_Remark_time";
				colvarManagerRemarkTime.DataType = DbType.DateTime;
				colvarManagerRemarkTime.MaxLength = 0;
				colvarManagerRemarkTime.AutoIncrement = false;
				colvarManagerRemarkTime.IsNullable = true;
				colvarManagerRemarkTime.IsPrimaryKey = false;
				colvarManagerRemarkTime.IsForeignKey = false;
				colvarManagerRemarkTime.IsReadOnly = false;
				colvarManagerRemarkTime.DefaultSetting = @"";
				colvarManagerRemarkTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarManagerRemarkTime);
				
				TableSchema.TableColumn colvarInTime = new TableSchema.TableColumn(schema);
				colvarInTime.ColumnName = "inTime";
				colvarInTime.DataType = DbType.DateTime;
				colvarInTime.MaxLength = 0;
				colvarInTime.AutoIncrement = false;
				colvarInTime.IsNullable = true;
				colvarInTime.IsPrimaryKey = false;
				colvarInTime.IsForeignKey = false;
				colvarInTime.IsReadOnly = false;
				
						colvarInTime.DefaultSetting = @"(getdate())";
				colvarInTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarInTime);
				
				TableSchema.TableColumn colvarStatus = new TableSchema.TableColumn(schema);
				colvarStatus.ColumnName = "Status";
				colvarStatus.DataType = DbType.Int32;
				colvarStatus.MaxLength = 0;
				colvarStatus.AutoIncrement = false;
				colvarStatus.IsNullable = true;
				colvarStatus.IsPrimaryKey = false;
				colvarStatus.IsForeignKey = false;
				colvarStatus.IsReadOnly = false;
				colvarStatus.DefaultSetting = @"";
				colvarStatus.ForeignKeyTableName = "";
				schema.Columns.Add(colvarStatus);
				
				TableSchema.TableColumn colvarGuid = new TableSchema.TableColumn(schema);
				colvarGuid.ColumnName = "Guid";
				colvarGuid.DataType = DbType.Guid;
				colvarGuid.MaxLength = 0;
				colvarGuid.AutoIncrement = false;
				colvarGuid.IsNullable = true;
				colvarGuid.IsPrimaryKey = false;
				colvarGuid.IsForeignKey = false;
				colvarGuid.IsReadOnly = false;
				colvarGuid.DefaultSetting = @"";
				colvarGuid.ForeignKeyTableName = "";
				schema.Columns.Add(colvarGuid);
				
				BaseSchema = schema;
				//add this schema to the provider
				//so we can query it later
				DataService.Providers["CXDB"].AddSchema("CX_Company_PingJia",schema);
			}
		}
		#endregion
		
		#region Props
		  
		[XmlAttribute("Id")]
		[Bindable(true)]
		public int Id 
		{
			get { return GetColumnValue<int>(Columns.Id); }
			set { SetColumnValue(Columns.Id, value); }
		}
		  
		[XmlAttribute("CompanyID")]
		[Bindable(true)]
		public string CompanyID 
		{
			get { return GetColumnValue<string>(Columns.CompanyID); }
			set { SetColumnValue(Columns.CompanyID, value); }
		}
		  
		[XmlAttribute("CompanyName")]
		[Bindable(true)]
		public string CompanyName 
		{
			get { return GetColumnValue<string>(Columns.CompanyName); }
			set { SetColumnValue(Columns.CompanyName, value); }
		}
		  
		[XmlAttribute("UnFeeTime")]
		[Bindable(true)]
		public DateTime? UnFeeTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.UnFeeTime); }
			set { SetColumnValue(Columns.UnFeeTime, value); }
		}
		  
		[XmlAttribute("UnFeeCash")]
		[Bindable(true)]
		public int? UnFeeCash 
		{
			get { return GetColumnValue<int?>(Columns.UnFeeCash); }
			set { SetColumnValue(Columns.UnFeeCash, value); }
		}
		  
		[XmlAttribute("UnFeeDetail")]
		[Bindable(true)]
		public string UnFeeDetail 
		{
			get { return GetColumnValue<string>(Columns.UnFeeDetail); }
			set { SetColumnValue(Columns.UnFeeDetail, value); }
		}
		  
		[XmlAttribute("ThiefTime1")]
		[Bindable(true)]
		public DateTime? ThiefTime1 
		{
			get { return GetColumnValue<DateTime?>(Columns.ThiefTime1); }
			set { SetColumnValue(Columns.ThiefTime1, value); }
		}
		  
		[XmlAttribute("ThiefTime2")]
		[Bindable(true)]
		public DateTime? ThiefTime2 
		{
			get { return GetColumnValue<DateTime?>(Columns.ThiefTime2); }
			set { SetColumnValue(Columns.ThiefTime2, value); }
		}
		  
		[XmlAttribute("ThiefCash")]
		[Bindable(true)]
		public int? ThiefCash 
		{
			get { return GetColumnValue<int?>(Columns.ThiefCash); }
			set { SetColumnValue(Columns.ThiefCash, value); }
		}
		  
		[XmlAttribute("ThiefDetail")]
		[Bindable(true)]
		public string ThiefDetail 
		{
			get { return GetColumnValue<string>(Columns.ThiefDetail); }
			set { SetColumnValue(Columns.ThiefDetail, value); }
		}
		  
		[XmlAttribute("UnCoopPeakTime")]
		[Bindable(true)]
		public DateTime? UnCoopPeakTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.UnCoopPeakTime); }
			set { SetColumnValue(Columns.UnCoopPeakTime, value); }
		}
		  
		[XmlAttribute("UnCoopPeakDetail")]
		[Bindable(true)]
		public string UnCoopPeakDetail 
		{
			get { return GetColumnValue<string>(Columns.UnCoopPeakDetail); }
			set { SetColumnValue(Columns.UnCoopPeakDetail, value); }
		}
		  
		[XmlAttribute("UnCoopLimitTime")]
		[Bindable(true)]
		public DateTime? UnCoopLimitTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.UnCoopLimitTime); }
			set { SetColumnValue(Columns.UnCoopLimitTime, value); }
		}
		  
		[XmlAttribute("UnCoopLimitDetail")]
		[Bindable(true)]
		public string UnCoopLimitDetail 
		{
			get { return GetColumnValue<string>(Columns.UnCoopLimitDetail); }
			set { SetColumnValue(Columns.UnCoopLimitDetail, value); }
		}
		  
		[XmlAttribute("UnCoopOthers")]
		[Bindable(true)]
		public string UnCoopOthers 
		{
			get { return GetColumnValue<string>(Columns.UnCoopOthers); }
			set { SetColumnValue(Columns.UnCoopOthers, value); }
		}
		  
		[XmlAttribute("EnterUserId")]
		[Bindable(true)]
		public int? EnterUserId 
		{
			get { return GetColumnValue<int?>(Columns.EnterUserId); }
			set { SetColumnValue(Columns.EnterUserId, value); }
		}
		  
		[XmlAttribute("DeptMasterId")]
		[Bindable(true)]
		public int? DeptMasterId 
		{
			get { return GetColumnValue<int?>(Columns.DeptMasterId); }
			set { SetColumnValue(Columns.DeptMasterId, value); }
		}
		  
		[XmlAttribute("DeptMasterRemark")]
		[Bindable(true)]
		public string DeptMasterRemark 
		{
			get { return GetColumnValue<string>(Columns.DeptMasterRemark); }
			set { SetColumnValue(Columns.DeptMasterRemark, value); }
		}
		  
		[XmlAttribute("DeptMasterStatus")]
		[Bindable(true)]
		public int? DeptMasterStatus 
		{
			get { return GetColumnValue<int?>(Columns.DeptMasterStatus); }
			set { SetColumnValue(Columns.DeptMasterStatus, value); }
		}
		  
		[XmlAttribute("DeptMasterEnteringTime")]
		[Bindable(true)]
		public DateTime? DeptMasterEnteringTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.DeptMasterEnteringTime); }
			set { SetColumnValue(Columns.DeptMasterEnteringTime, value); }
		}
		  
		[XmlAttribute("OtherMasterId")]
		[Bindable(true)]
		public int? OtherMasterId 
		{
			get { return GetColumnValue<int?>(Columns.OtherMasterId); }
			set { SetColumnValue(Columns.OtherMasterId, value); }
		}
		  
		[XmlAttribute("OtherMasterTime")]
		[Bindable(true)]
		public DateTime? OtherMasterTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.OtherMasterTime); }
			set { SetColumnValue(Columns.OtherMasterTime, value); }
		}
		  
		[XmlAttribute("OtherMasterStatus")]
		[Bindable(true)]
		public int? OtherMasterStatus 
		{
			get { return GetColumnValue<int?>(Columns.OtherMasterStatus); }
			set { SetColumnValue(Columns.OtherMasterStatus, value); }
		}
		  
		[XmlAttribute("OtherMasterRemark")]
		[Bindable(true)]
		public string OtherMasterRemark 
		{
			get { return GetColumnValue<string>(Columns.OtherMasterRemark); }
			set { SetColumnValue(Columns.OtherMasterRemark, value); }
		}
		  
		[XmlAttribute("ManagerId")]
		[Bindable(true)]
		public int? ManagerId 
		{
			get { return GetColumnValue<int?>(Columns.ManagerId); }
			set { SetColumnValue(Columns.ManagerId, value); }
		}
		  
		[XmlAttribute("ManagerStatus")]
		[Bindable(true)]
		public int? ManagerStatus 
		{
			get { return GetColumnValue<int?>(Columns.ManagerStatus); }
			set { SetColumnValue(Columns.ManagerStatus, value); }
		}
		  
		[XmlAttribute("ManagerRemark")]
		[Bindable(true)]
		public string ManagerRemark 
		{
			get { return GetColumnValue<string>(Columns.ManagerRemark); }
			set { SetColumnValue(Columns.ManagerRemark, value); }
		}
		  
		[XmlAttribute("ManagerRemarkTime")]
		[Bindable(true)]
		public DateTime? ManagerRemarkTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.ManagerRemarkTime); }
			set { SetColumnValue(Columns.ManagerRemarkTime, value); }
		}
		  
		[XmlAttribute("InTime")]
		[Bindable(true)]
		public DateTime? InTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.InTime); }
			set { SetColumnValue(Columns.InTime, value); }
		}
		  
		[XmlAttribute("Status")]
		[Bindable(true)]
		public int? Status 
		{
			get { return GetColumnValue<int?>(Columns.Status); }
			set { SetColumnValue(Columns.Status, value); }
		}
		  
		[XmlAttribute("Guid")]
		[Bindable(true)]
		public Guid? Guid 
		{
			get { return GetColumnValue<Guid?>(Columns.Guid); }
			set { SetColumnValue(Columns.Guid, value); }
		}
		
		#endregion
		
		
			
		
		//no foreign key tables defined (0)
		
		
		
		//no ManyToMany tables defined (0)
		
        
        
		#region ObjectDataSource support
		
		
		/// <summary>
		/// Inserts a record, can be used with the Object Data Source
		/// </summary>
		public static void Insert(string varCompanyID,string varCompanyName,DateTime? varUnFeeTime,int? varUnFeeCash,string varUnFeeDetail,DateTime? varThiefTime1,DateTime? varThiefTime2,int? varThiefCash,string varThiefDetail,DateTime? varUnCoopPeakTime,string varUnCoopPeakDetail,DateTime? varUnCoopLimitTime,string varUnCoopLimitDetail,string varUnCoopOthers,int? varEnterUserId,int? varDeptMasterId,string varDeptMasterRemark,int? varDeptMasterStatus,DateTime? varDeptMasterEnteringTime,int? varOtherMasterId,DateTime? varOtherMasterTime,int? varOtherMasterStatus,string varOtherMasterRemark,int? varManagerId,int? varManagerStatus,string varManagerRemark,DateTime? varManagerRemarkTime,DateTime? varInTime,int? varStatus,Guid? varGuid)
		{
			CxCompanyPingJium item = new CxCompanyPingJium();
			
			item.CompanyID = varCompanyID;
			
			item.CompanyName = varCompanyName;
			
			item.UnFeeTime = varUnFeeTime;
			
			item.UnFeeCash = varUnFeeCash;
			
			item.UnFeeDetail = varUnFeeDetail;
			
			item.ThiefTime1 = varThiefTime1;
			
			item.ThiefTime2 = varThiefTime2;
			
			item.ThiefCash = varThiefCash;
			
			item.ThiefDetail = varThiefDetail;
			
			item.UnCoopPeakTime = varUnCoopPeakTime;
			
			item.UnCoopPeakDetail = varUnCoopPeakDetail;
			
			item.UnCoopLimitTime = varUnCoopLimitTime;
			
			item.UnCoopLimitDetail = varUnCoopLimitDetail;
			
			item.UnCoopOthers = varUnCoopOthers;
			
			item.EnterUserId = varEnterUserId;
			
			item.DeptMasterId = varDeptMasterId;
			
			item.DeptMasterRemark = varDeptMasterRemark;
			
			item.DeptMasterStatus = varDeptMasterStatus;
			
			item.DeptMasterEnteringTime = varDeptMasterEnteringTime;
			
			item.OtherMasterId = varOtherMasterId;
			
			item.OtherMasterTime = varOtherMasterTime;
			
			item.OtherMasterStatus = varOtherMasterStatus;
			
			item.OtherMasterRemark = varOtherMasterRemark;
			
			item.ManagerId = varManagerId;
			
			item.ManagerStatus = varManagerStatus;
			
			item.ManagerRemark = varManagerRemark;
			
			item.ManagerRemarkTime = varManagerRemarkTime;
			
			item.InTime = varInTime;
			
			item.Status = varStatus;
			
			item.Guid = varGuid;
			
		
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}
		
		/// <summary>
		/// Updates a record, can be used with the Object Data Source
		/// </summary>
		public static void Update(int varId,string varCompanyID,string varCompanyName,DateTime? varUnFeeTime,int? varUnFeeCash,string varUnFeeDetail,DateTime? varThiefTime1,DateTime? varThiefTime2,int? varThiefCash,string varThiefDetail,DateTime? varUnCoopPeakTime,string varUnCoopPeakDetail,DateTime? varUnCoopLimitTime,string varUnCoopLimitDetail,string varUnCoopOthers,int? varEnterUserId,int? varDeptMasterId,string varDeptMasterRemark,int? varDeptMasterStatus,DateTime? varDeptMasterEnteringTime,int? varOtherMasterId,DateTime? varOtherMasterTime,int? varOtherMasterStatus,string varOtherMasterRemark,int? varManagerId,int? varManagerStatus,string varManagerRemark,DateTime? varManagerRemarkTime,DateTime? varInTime,int? varStatus,Guid? varGuid)
		{
			CxCompanyPingJium item = new CxCompanyPingJium();
			
				item.Id = varId;
			
				item.CompanyID = varCompanyID;
			
				item.CompanyName = varCompanyName;
			
				item.UnFeeTime = varUnFeeTime;
			
				item.UnFeeCash = varUnFeeCash;
			
				item.UnFeeDetail = varUnFeeDetail;
			
				item.ThiefTime1 = varThiefTime1;
			
				item.ThiefTime2 = varThiefTime2;
			
				item.ThiefCash = varThiefCash;
			
				item.ThiefDetail = varThiefDetail;
			
				item.UnCoopPeakTime = varUnCoopPeakTime;
			
				item.UnCoopPeakDetail = varUnCoopPeakDetail;
			
				item.UnCoopLimitTime = varUnCoopLimitTime;
			
				item.UnCoopLimitDetail = varUnCoopLimitDetail;
			
				item.UnCoopOthers = varUnCoopOthers;
			
				item.EnterUserId = varEnterUserId;
			
				item.DeptMasterId = varDeptMasterId;
			
				item.DeptMasterRemark = varDeptMasterRemark;
			
				item.DeptMasterStatus = varDeptMasterStatus;
			
				item.DeptMasterEnteringTime = varDeptMasterEnteringTime;
			
				item.OtherMasterId = varOtherMasterId;
			
				item.OtherMasterTime = varOtherMasterTime;
			
				item.OtherMasterStatus = varOtherMasterStatus;
			
				item.OtherMasterRemark = varOtherMasterRemark;
			
				item.ManagerId = varManagerId;
			
				item.ManagerStatus = varManagerStatus;
			
				item.ManagerRemark = varManagerRemark;
			
				item.ManagerRemarkTime = varManagerRemarkTime;
			
				item.InTime = varInTime;
			
				item.Status = varStatus;
			
				item.Guid = varGuid;
			
			item.IsNew = false;
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}
		#endregion
        
        
        
        #region Typed Columns
        
        
        public static TableSchema.TableColumn IdColumn
        {
            get { return Schema.Columns[0]; }
        }
        
        
        
        public static TableSchema.TableColumn CompanyIDColumn
        {
            get { return Schema.Columns[1]; }
        }
        
        
        
        public static TableSchema.TableColumn CompanyNameColumn
        {
            get { return Schema.Columns[2]; }
        }
        
        
        
        public static TableSchema.TableColumn UnFeeTimeColumn
        {
            get { return Schema.Columns[3]; }
        }
        
        
        
        public static TableSchema.TableColumn UnFeeCashColumn
        {
            get { return Schema.Columns[4]; }
        }
        
        
        
        public static TableSchema.TableColumn UnFeeDetailColumn
        {
            get { return Schema.Columns[5]; }
        }
        
        
        
        public static TableSchema.TableColumn ThiefTime1Column
        {
            get { return Schema.Columns[6]; }
        }
        
        
        
        public static TableSchema.TableColumn ThiefTime2Column
        {
            get { return Schema.Columns[7]; }
        }
        
        
        
        public static TableSchema.TableColumn ThiefCashColumn
        {
            get { return Schema.Columns[8]; }
        }
        
        
        
        public static TableSchema.TableColumn ThiefDetailColumn
        {
            get { return Schema.Columns[9]; }
        }
        
        
        
        public static TableSchema.TableColumn UnCoopPeakTimeColumn
        {
            get { return Schema.Columns[10]; }
        }
        
        
        
        public static TableSchema.TableColumn UnCoopPeakDetailColumn
        {
            get { return Schema.Columns[11]; }
        }
        
        
        
        public static TableSchema.TableColumn UnCoopLimitTimeColumn
        {
            get { return Schema.Columns[12]; }
        }
        
        
        
        public static TableSchema.TableColumn UnCoopLimitDetailColumn
        {
            get { return Schema.Columns[13]; }
        }
        
        
        
        public static TableSchema.TableColumn UnCoopOthersColumn
        {
            get { return Schema.Columns[14]; }
        }
        
        
        
        public static TableSchema.TableColumn EnterUserIdColumn
        {
            get { return Schema.Columns[15]; }
        }
        
        
        
        public static TableSchema.TableColumn DeptMasterIdColumn
        {
            get { return Schema.Columns[16]; }
        }
        
        
        
        public static TableSchema.TableColumn DeptMasterRemarkColumn
        {
            get { return Schema.Columns[17]; }
        }
        
        
        
        public static TableSchema.TableColumn DeptMasterStatusColumn
        {
            get { return Schema.Columns[18]; }
        }
        
        
        
        public static TableSchema.TableColumn DeptMasterEnteringTimeColumn
        {
            get { return Schema.Columns[19]; }
        }
        
        
        
        public static TableSchema.TableColumn OtherMasterIdColumn
        {
            get { return Schema.Columns[20]; }
        }
        
        
        
        public static TableSchema.TableColumn OtherMasterTimeColumn
        {
            get { return Schema.Columns[21]; }
        }
        
        
        
        public static TableSchema.TableColumn OtherMasterStatusColumn
        {
            get { return Schema.Columns[22]; }
        }
        
        
        
        public static TableSchema.TableColumn OtherMasterRemarkColumn
        {
            get { return Schema.Columns[23]; }
        }
        
        
        
        public static TableSchema.TableColumn ManagerIdColumn
        {
            get { return Schema.Columns[24]; }
        }
        
        
        
        public static TableSchema.TableColumn ManagerStatusColumn
        {
            get { return Schema.Columns[25]; }
        }
        
        
        
        public static TableSchema.TableColumn ManagerRemarkColumn
        {
            get { return Schema.Columns[26]; }
        }
        
        
        
        public static TableSchema.TableColumn ManagerRemarkTimeColumn
        {
            get { return Schema.Columns[27]; }
        }
        
        
        
        public static TableSchema.TableColumn InTimeColumn
        {
            get { return Schema.Columns[28]; }
        }
        
        
        
        public static TableSchema.TableColumn StatusColumn
        {
            get { return Schema.Columns[29]; }
        }
        
        
        
        public static TableSchema.TableColumn GuidColumn
        {
            get { return Schema.Columns[30]; }
        }
        
        
        
        #endregion
		#region Columns Struct
		public struct Columns
		{
			 public static string Id = @"ID";
			 public static string CompanyID = @"CompanyID";
			 public static string CompanyName = @"CompanyName";
			 public static string UnFeeTime = @"unFee_time";
			 public static string UnFeeCash = @"unFee_Cash";
			 public static string UnFeeDetail = @"unFee_Detail";
			 public static string ThiefTime1 = @"thief_Time1";
			 public static string ThiefTime2 = @"thief_Time2";
			 public static string ThiefCash = @"thief_Cash";
			 public static string ThiefDetail = @"thief_Detail";
			 public static string UnCoopPeakTime = @"unCoop_Peak_time";
			 public static string UnCoopPeakDetail = @"unCoop_Peak_Detail";
			 public static string UnCoopLimitTime = @"unCoop_Limit_time";
			 public static string UnCoopLimitDetail = @"unCoop_Limit_Detail";
			 public static string UnCoopOthers = @"unCoop_Others";
			 public static string EnterUserId = @"Enter_user_ID";
			 public static string DeptMasterId = @"Dept_Master_ID";
			 public static string DeptMasterRemark = @"Dept_Master_Remark";
			 public static string DeptMasterStatus = @"Dept_Master_status";
			 public static string DeptMasterEnteringTime = @"Dept_Master_Entering_time";
			 public static string OtherMasterId = @"other_master_id";
			 public static string OtherMasterTime = @"other_master_time";
			 public static string OtherMasterStatus = @"other_master_status";
			 public static string OtherMasterRemark = @"other_master_remark";
			 public static string ManagerId = @"Manager_ID";
			 public static string ManagerStatus = @"Manager_Status";
			 public static string ManagerRemark = @"Manager_Remark";
			 public static string ManagerRemarkTime = @"Manager_Remark_time";
			 public static string InTime = @"inTime";
			 public static string Status = @"Status";
			 public static string Guid = @"Guid";
						
		}
		#endregion
		
		#region Update PK Collections
		
        #endregion
    
        #region Deep Save
		
        #endregion
	}
}
